const path = require('path')
const resolve = dir => {
  return path.join(__dirname, dir)
}
const name = '可视化大屏';
module.exports = {
  publicPath: './',
  lintOnSave: false,
  devServer: {
    port: 8083,
    open: false,
    proxy: {
      [process.env.VUE_APP_BASE_API]: {
        // 线上接口API地址
        // target: "http://120.195.25.226:82/chne-implement/",
        target: "http://36.138.43.160:82/chne-implement/",
        // 本地接口API地址
        // target: "http://192.168.2.116:8081",  // 段郎
        // target: "http://192.168.10.44:8082", // 华哥
        // target: "http://192.168.2.79:8082", // 冯金矿
        // target: "http://192.168.2.76:8084", // 黄大仙
        changeOrigin: true,
        pathRewrite: {
          ["" + process.env.VUE_APP_BASE_API]: ""
        }
      }
    },
    overlay: {
      warnings: false,
      errors: true
    }
  },
  configureWebpack: {
    // provide the app's title in webpack's name field, so that
    // it can be accessed in index.html to inject the correct title.
    name: name,
    resolve: {
      alias: {
        "@": resolve("src")
      }
    }
  },
  chainWebpack: config => {
    config.resolve.alias
      .set('_c', resolve('src/components')) // key,value自行定义，比如.set('@@', resolve('src/components'))
  },
}

